1
'****************************** Module Header ******************************'
2 ' Module Name: MainModule.vb
3 ' Project: VBEFEntityDataModel
4 ' Copyright (c) Microsoft Corporation.
6 ' The VBEFEntityDataModel example illustrates how to work with EDM in various
7 ' ways. It includes many to many association, one to many association, one to
8 ' one association, table merging, table splitting, table per hierarchy
9 ' inheritance, and table per type inheritance. In the example, you will see
10 ' the insert, update and query operations to entities.
12 ' This source is subject to the Microsoft Public License.
13 ' See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
14 ' All other rights reserved.
16 ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
17 ' EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
18 ' WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
19 '***************************************************************************'
21 #Region
"Imports directives"
22 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.TableSplitting
23 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.TablePerType
24 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.TablePerHierarchy
25 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.TableMerging
26 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.One2One
27 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.One2Many
28 Imports VBEFEntityDataModel
.VBEFEntityDataModel
.Many2Many
35 Console
.WriteLine("Many-to-Many test:")
37 ' Perform the insert, update and query operations to entities
38 ' with many to many association.
39 Many2ManyClass
.Many2ManyTest()
43 Console
.WriteLine("One-to-Many test:")
45 ' Perform the insert, update and query operations to entities
46 ' with one to many association.
47 One2ManyClass
.One2ManyTest()
51 Console
.WriteLine("One-to-One test:")
53 ' Perform the insert, update and query operations to entities
54 ' with one to one association.
55 One2OneClass
.One2OneTest()
59 Console
.WriteLine("Table merging test:")
61 ' Perform the query operation to merged entity
62 TableMergingClass
.TableMergingTest()
66 Console
.WriteLine("Table splitting test:")
68 ' Perform the insert and query operations in separate table
69 TableSplittingClass
.TableSplittingTest()
73 Console
.WriteLine("Table-Per-Hierarchy inheritance test:")
75 ' Perform the query operation to entities in TablePerType
80 Console
.WriteLine("Table-Per-Type inheritance test:")
82 ' Perform the query operation to entities in TablePerHierarchy